package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUserAccount;
import com.appkubes.mall.core.po.MallUserAccountExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUserAccountMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountSqlProvider.class, method="countByExample")
    long countByExample(MallUserAccountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUserAccountSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUserAccountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_user_account",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_user_account (user_key, app_key, ",
        "total_brokerage, create_time, ",
        "update_time, version)",
        "values (#{userKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{totalBrokerage,jdbcType=DECIMAL}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallUserAccount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUserAccountSqlProvider.class, method="insertSelective")
    int insertSelective(MallUserAccount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="total_brokerage", property="totalBrokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserAccount> selectByExampleWithRowbounds(MallUserAccountExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserAccountSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="total_brokerage", property="totalBrokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserAccount> selectByExample(MallUserAccountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "user_key, app_key, total_brokerage, create_time, update_time, version",
        "from mall_user_account",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="total_brokerage", property="totalBrokerage", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUserAccount selectByPrimaryKey(String userKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUserAccount record, @Param("example") MallUserAccountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUserAccount record, @Param("example") MallUserAccountExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserAccountSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUserAccount record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_account
     *
     * @mbg.generated
     */
    @Update({
        "update mall_user_account",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "total_brokerage = #{totalBrokerage,jdbcType=DECIMAL},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where user_key = #{userKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUserAccount record);
}